package com.example.zyfapplication.utils;

import android.view.View;

public abstract class OnMultiClickListener implements View.OnClickListener {

    private int MIN_CLICK_DELAY_TIME = 1000;
    private static long lastClickTime = 0;

    @Override
    public void onClick(View v) {

        long currentTimeMillis = System.currentTimeMillis();
        if ((currentTimeMillis - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            //超过时间间隔，可以点击了
            lastClickTime = currentTimeMillis;
            onMultiClick(v);
        } else {
//            ToastUtil.show("时间间隔不够");
        }

    }

    public abstract void onMultiClick(View v);
}
